home *** CD-ROM | disk | FTP | other *** search
- Path: news.larc.nasa.gov!amiga-request
- From: amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
- Subject: v91i010: rxgen - call any library function from arexx, Part01/01
- Reply-To: rouaix@margaux.inria.fr
- Newsgroups: comp.sources.amiga
- Message-ID: <comp.sources.amiga:v91i010@ab20.larc.nasa.gov>
- Date: 12 Feb 91 00:28:32 GMT
- Approved: tadguy@uunet.UU.NET (Tad Guy)
- X-Mail-Submissions-To: amiga@uunet.uu.net
- X-Post-Discussions-To: comp.sys.amiga.misc
-
- Submitted-by: rouaix@margaux.inria.fr
- Posting-number: Volume 91, Issue 010
- Archive-name: rexx/rxgen/part01
-
- RXGEN is an ARexx library designed for the hacker.
- This library allows you to call any function of (almost) any amiga
- library from a Arexx program.
- I would say it is essentially useful under 2.0 to test some of
- the new "high-level" features of the system. It also works under 1.3.
- You can use the library to write small programs, when you don't want
- to use your C-compiler ! Eventually, your program will get bigger and
- bigger, and you'll find out that either you don't need your C-compiler,
- or that Arexx is slow (heheh).
- --Francois
-
- #!/bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 1 (of 1)."
- # Contents: libs libs/rxgen.uu rexx rexx/FD2rxFD.rexx rexx/alert.rexx
- # rexx/db.rexx rexx/fd.rexx rexx/port.rexx rexx/wbfront.rexx
- # rexx/wbmaster.rexx rxgen.doc rxgen.readme
- # Wrapped by tadguy@ab20 on Mon Feb 11 19:28:29 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test ! -d 'libs' ; then
- echo shar: Creating directory \"'libs'\"
- mkdir 'libs'
- fi
- if test -f 'libs/rxgen.uu' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libs/rxgen.uu'\"
- else
- echo shar: Extracting \"'libs/rxgen.uu'\" \(6963 characters\)
- sed "s/^X//" >'libs/rxgen.uu' <<'END_OF_FILE'
- Xbegin 700 rxgen.library
- XM```#\P`````````"``````````$```1,````*0```^D```1,<`!.=4K\````G
- XM!````6V``0D`````'@```"P```!.<GAG96XN;&EB<F%R>0!R>&=E;BYL:6)R6
- XM87)Y(#$N,"`H,3<@07!R(#$Y.#DI#0H`````+````%X```!V````H@```,X`9
- XM``#<````\@```3P```%`_____^````P)`,````H````>X```#@8`T```%``!^
- XMT```%@``P```&````"P`````+PTJ0"M.`"(CS@```5(K2``F0_D```%:<")._
- XMKOW8(\````%69P(@#2I?3G52;@`@"*X``P`J(`Y.=7``4VX`(&8,""X``P`JY
- XM9P1A```$3G5(YR`&*DXL;0`B2FT`(&<```P([0`#`"IP`&`H)"T`)B!-3J[_>
- XM!")Y```!5DZN_F)P`")-,"T`$)/`T&T`$DZN_RX@`DS?8`1.=7``3G59CR\/V
- XM+PA.N0```;Y03R!?3G4``````````')E>'AS>7-L:6(N;&EB<F%R>0````!.L
- XM5?_X2.<!`'#_*T#_^'X`#(<````$;"H@!W(,3KH/3B!`T?P````L+Q`O+0`(^
- XM3KH/7%!/2H!F!BM'__A@!%*'8,X@+?_X3-\`@$Y=3G5.5?[L2.<@`$*M_O`@2
- XM;0`(+R@`*&&<6$\K0/_X#(#_____9P``Q"!M``@B*``<`H$````/+T$`!'(,L
- XM3KH.XB!`T?P````L)"\`!+2H``AL!G`18```IB`M__A.N@["($#1_````"PB<
- XM:``$2&W^]"\M``A.D5!/*T#__$J`9G`@+?[T!(`````!;60,@`````1L7..`+
- XM3OL(`F`.8!Q@+DYQ*VW^^/[P8$8O+?[X3KH-$%A/*T#^\&`V2'@`!$AM_OA.V
- XMN@S,4$\K0/[P8")(;?[X3KH.C%A/+P!(;?[X3KH,L%!/*T#^\&`&<`$K0/_\3
- XM(&T`#""M_O`@+?_\3-\`!$Y=3G5.5?_<<``K0/_H*T#_X"!M``@O*``L*T#_%
- XMW"M`__!.N@P,6$\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)EE@R"]9``Q@PBI98+X@M
- XM&6"Z(!E@MB]9``!@L"(98*PD&6"H)AE@I"@98*`J&6"<+!E@F"X98)0```N"N
- XM```+J@``"[````NT```+N```"[P```O````+Q```"\@```N$```+B@``"Y``E
- XM``N4```+F```"YX```NB```+IDSO`P$`!$CG/SXN`%?(``@O,0``8/9.D-_''
- XM3-]\_$YU(&\`!$CG("(D2"QY````!$/Z`@9P`$ZN_=@D`&<<(D!.KOYB<`"T.
- XMJ@`89@XB*@`49P@@2BQ"3J[_6$J`3-]$!$YU3.\#```$80IF!B!O``P@B4YU0
- XM2.<0/B1()DEAIF<P+&H`&"!J`!1.KO^4*$@@2V$``+AF'"1))`$@3"`"<@!.G
- XMKO^X<`!0B4J!9P:3R6`"<`I*@$S??`A.=4SO`P``!$SO``,`#$CG/SY/[__T#
- XM)$@F22I`)@%!^@!8(D]A``$D($IA`/]`9TPL:@`8<`D,@P``__]N0"!J`!1.!
- XMKO^4*$@@2V$``$9F+B1))`$@3"`"3J[_OB@`($PB32`#80``EF<.($PB0"`$T
- XM3J[_K'``8`9P`V`"<`H@3R\`80``YB`?3^\`#$S??/Q.=4CG,#!T`'8`3J[^3
- XMX")(($QA6"1`9S9#Z@`(,"H`!"()#!D`+E?(__IF$,.)DHDF"B!,(`%A-"1`L
- XM9Q)!Z@`(3J[_FK)J``1G!G0H8`)T`TJ"9PP@3")*848@3")#84`B2B(#(`),R
- XMWPP,3G5(YX!`4(!2@$ZN_XY,WP(!9QXO"$*0,4``!!%\``(`!D(P"`A0B$ZNP
- XM_O(@7Q%```<@"$YU(@EG%'`!P"D`!F8,,"D`!%"`4H!.KO^(3G4O"R9J`!0CP
- XM2@``3.L``P#\2.L#``#\2.D``P`$)E].=2)H```B:0`43.@``P`$2.D``P#\&
- XM3G5R97AX<WES;&EB+FQI8G)A<GD``#(\_U)@<#(\_JI@:C(\_Q!@9'*48&`RK
- XM//\T8%HR//YH8%0R//]P8$XR//]\8$@R//]J8$(R//YZ8#PR//YT8#8R//YN8
- XM8#`R//YB8"HR//Z`8"0R//],8!YRB&`:,CS_%F`4<II@$#(\_R)@"C(\_QQ@8
- XM!#(\_UA,[P,```0@+P`,+PXL>0```59.MA``+%].=3(\_W9@X#(\_SI@VC(\S
- XM_HQ@U#(\_IY@SC(\_J1@R#(\_T9@PC(\_T!@O#(\_D1@MC(\_P1@L#(\_OY@=
- XMJC(\_OA@I#(\_O)@GC(\_NQ@F#(\_N!@DC(\_H9@C#(\_IA@AG*"8"`R//\H-
- XM8!HR//]D8!0R//Y08`YRCF`*,CS_+F`$,CS^YB!O``0@+P`(8`#_8C(\_LA@C
- XM$#(\_CY@"C(\_MI@!#(\_C@@+P`$8`#_1#)\_LY@$#)\_L)@"C)\_UY@!#)\'
- XM_I(@;P`$3.\``P`(+PXL>0```59.MI``+%].=4SO`P,`!,&(PXDO#BQY```!!
- XM5DZN_DHL7TYU3.\#`P`$P8C#B2\.+'D```%63J[^O"Q?3G5,[P,#``3!B,.)9
- XM+PXL>0```59.KOZV+%].=4SO`P,`!,&(PXDO#BQY```!5DZN_K`L7TYU(&\`1
- XM!#(\_M1A`/Z@(F\`""*!3G4@+P`$<J!A`/Z.(F\`""*(3G5(YP`Z)F\`%"!O[
- XM`!A#[P`<1?H`$BQY````!$ZN_?9,WUP`3G46P$YU+PXL>0```5),[P`#``A.[
- XMKO\Z+%].=0``+PXL>0```5(B;P`(("\`#$ZN_RXL7TYU+PXL>0```5(B;P`(C
- XM3J[^8BQ?3G4O#BQY```!4B)O``@@+P`,3J[]V"Q?3G4@0B)#)``F`4A"2$/$=
- XMP<;`P,'40TA"0D+0@B8))`A.=2!O``0B;P`($ABR&68(2@%F]G``3G5N!'#_G
- XM3G5P`4YU(&\`!$H89OQ3B)'O``0@"$YU``````/L````,0```````!#(```0@
- XMM```$)P``!"$```0)@``$`P```_R```/V```#[X```[@```,#```#`@```P$E
- XM```,````"_P```OX```+]```"_````OL```+Z```"^0```O@```+W```"]@`>
- XM``O4```+T```"\P```ML```+4````4@```$:````P@```+8```"L````F@``%
- XM`(````!N````:@```&8```!B````7@```%H```!6````4@```!H````6````P
- XM$@````H````&````#0````$```I6```*%@``"&````@.```%R@``!4P```06H
- XM```#V@```Y8```,V```"(````@````&4`````````_(```/J````*4=%3D]0L
- XM14Y,24(``$=%3D-,3U-%3$E"`$=%3D%#04Q,``!'14Y#0T%,3```````````!
- XM`L`````"````#```!-0````!````&```!T8````"````(@``"4H````"````'
- XM````````````)7,N;&EB<F%R>0``3$E"4RXE<P!,24)3+B5S+D]014Y#3U5.P
- XM5````$Q)0E,N)7,`3$E"4RXE<RXE<P`````#[`````0`````````5````$@`)
- XG```\````,`````0````!````4````$0````X````+`````````/R>
- X``
- Xend
- Xsize 4944
- END_OF_FILE
- if test 6963 -ne `wc -c <'libs/rxgen.uu'`; then
- echo shar: \"'libs/rxgen.uu'\" unpacked with wrong size!
- fi
- # end of 'libs/rxgen.uu'
- fi
- if test ! -d 'rexx' ; then
- echo shar: Creating directory \"'rexx'\"
- mkdir 'rexx'
- fi
- if test -f 'rexx/FD2rxFD.rexx' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rexx/FD2rxFD.rexx'\"
- else
- echo shar: Extracting \"'rexx/FD2rxFD.rexx'\" \(3828 characters\)
- sed "s/^X//" >'rexx/FD2rxFD.rexx' <<'END_OF_FILE'
- X/* This file is Copyright(C) 1990 Francois Rouaix and the Software Winery */
- X/* This file must be distributed unmodified in the RXGEN package */
- X
- X
- X/* Transformation of _lib.fd files into .rxfd files */
- X/* SYNTAX: fdtorxfd <library name> */
- X/* Example: fdtorxfd exec */
- X/* You will have to configure the variables */
- X/* fddir : directory of FD.FILES */
- X/* rxfddir : directory where to put .rxfd files */
- X/* This program should take care of most of the */
- X/* irregularities in the CBM FD.FILES */
- X/* Register coding is */
- X/* D0 D1 D2 D3 D4 D5 D6 D7 A0 A1 A2 A3 A4 A5 A6 A7 */
- X/* 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E ** ** */
- X/* A6 is reserved for library base */
- X/* A7 is SP (!) */
- X
- Xparse arg libname
- X
- Xfddir ="work:fd.files/"
- Xrxfddir ="work:rxgen/rxfd/"
- X
- Xsuccess = open('infd',lib2fd(libname),'Read')
- Xif ~success then do
- X say "I can't file FD file for" libname "in" fddir
- X exit 1
- X end
- Xsuccess = open('outrxfd',lib2rxfd(libname),'Write')
- Xif ~success then do
- X say "I can't open RXFD file for" libname "in" rxfddir
- X exit 1
- X end
- Xoffset = 0
- Xcall writeln('outrxfd',"LIBRARIES."||libname||" = '00 00 00 00'x")
- Xcall writeln('outrxfd',"LIBRARIES."||libname||".OPENCOUNT = 0")
- Xdo until eof('infd')
- X line = readln('infd')
- X select
- X when left(line,1) == '*' then nop /* skip comment */
- X when left(line,6) == '##bias' then do
- X parse var line '##bias' offset
- X offset = strip(offset) /* should be ok for multiple bias */
- X end
- X when left(line,8) == '##public' then nop
- X when left(line,9) == '##private' then nop
- X when left(line,6) == '##base' then nop
- X when left(line,5) == '##end' then leave
- X when length(line) == 0 then nop
- X otherwise do
- X firstopenpar=index(line,"(",1)
- X fname=substr(line,1,firstopenpar - 1)
- X call Writech('outrxfd',"LIBS."||libname||"."||fname||"=")
- X call Writech('outrxfd',"'"||d2x(65536 - offset)||"'x||")
- X offset = offset + 6
- X numpars = 0
- X regcoding = "'20"
- X secondopenpar=index(line,"(",firstopenpar + 1)
- X select /* are there any parameters ? */
- X when secondopenpar = 0 then nop
- X when substr(line,secondopenpar) = "()" then nop
- X otherwise do
- X line = substr(line,secondopenpar)
- X do until left(line,1) = ")"
- X parse var line with 1 sep 2 regtype 3 regnum 4 line
- X numpars = numpars + 1
- X select
- X when upper(regtype) = 'A' then regnum = regnum + 9
- X when upper(regtype) = 'D' then regnum = regnum + 1
- X otherwise do
- X say "Bad reg definition"
- X exit 5
- X end
- X end /* of select */
- X regcoding = regcoding||"0"||d2x(regnum)
- X end /* of do line */
- X end /* of otherwise*/
- X end /* of select */
- X if numpars ~= 0 then call writech('outrxfd',copies('?',numpars)||"||")
- X call writech('outrxfd',regcoding||"'x")
- X call writech('outrxfd','0A'x)
- X say fname
- X end /* of otherwise */
- X end /* of select */
- X end /* of do eof*/
- Xcall close('infd')
- Xcall close('outrxfd')
- Xexit 0
- X
- Xlib2fd: procedure expose fddir
- X arg libname
- X return fddir||libname||"_LIB.FD"
- X
- Xlib2rxfd: procedure expose rxfddir
- X arg libname
- X return rxfddir||libname||".rxfd"
- END_OF_FILE
- if test 3828 -ne `wc -c <'rexx/FD2rxFD.rexx'`; then
- echo shar: \"'rexx/FD2rxFD.rexx'\" unpacked with wrong size!
- fi
- chmod +x 'rexx/FD2rxFD.rexx'
- # end of 'rexx/FD2rxFD.rexx'
- fi
- if test -f 'rexx/alert.rexx' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rexx/alert.rexx'\"
- else
- echo shar: Extracting \"'rexx/alert.rexx'\" \(554 characters\)
- sed "s/^X//" >'rexx/alert.rexx' <<'END_OF_FILE'
- X/* AREXX program */
- XLIBS.intuition = '00 00 00 00'x
- XLIBS.intuition.OPENCOUNT = 0
- XLIBS.intuition.DisplayAlert='FFA6'x||ISI||'20010902'x
- Xif ~show('L','rxgen.library') then call addlib('rxgen.library',0,-30,0)
- X
- X/* have fun with user defined alert */
- X/* this should appear GREEN under 2.0 */
- X
- XAlert=0
- XAlertString1='0065 0A'x||"Yoho here is the Guru !"||'00'x
- XAlertString2='0065 14'x||"Don't you laugh at me !"||'00'x
- Xcall GenOpenLib("intuition",0)
- Xcall GenACall("intuition","DisplayAlert",Alert,AlertString1 AlertString2,40)
- Xcall GenCloseLib("intuition")
- X
- END_OF_FILE
- if test 554 -ne `wc -c <'rexx/alert.rexx'`; then
- echo shar: \"'rexx/alert.rexx'\" unpacked with wrong size!
- fi
- chmod +x 'rexx/alert.rexx'
- # end of 'rexx/alert.rexx'
- fi
- if test -f 'rexx/db.rexx' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rexx/db.rexx'\"
- else
- echo shar: Extracting \"'rexx/db.rexx'\" \(325 characters\)
- sed "s/^X//" >'rexx/db.rexx' <<'END_OF_FILE'
- X/* AREXX program */
- XLIBS.intuition = '00 00 00 00'x
- XLIBS.intuition.OPENCOUNT = 0
- XLIBS.intuition.DisplayBeep='FFA0'x||I||'2009'x
- X
- Xif ~show('L','rxgen.library') then call addlib('rxgen.library',0,-30,0)
- X
- X/* no fuss here */
- Xcall GenOpenLib("intuition",0)
- Xcall GenACall("intuition","DisplayBeep",0)
- Xcall GenCloseLib("intuition")
- END_OF_FILE
- if test 325 -ne `wc -c <'rexx/db.rexx'`; then
- echo shar: \"'rexx/db.rexx'\" unpacked with wrong size!
- fi
- chmod +x 'rexx/db.rexx'
- # end of 'rexx/db.rexx'
- fi
- if test -f 'rexx/fd.rexx' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rexx/fd.rexx'\"
- else
- echo shar: Extracting \"'rexx/fd.rexx'\" \(5018 characters\)
- sed "s/^X//" >'rexx/fd.rexx' <<'END_OF_FILE'
- X/* This file is Copyright(C) 1990 Francois Rouaix and the Software Winery */
- X/* This file must be distributed unmodified in the RXGEN package */
- X
- X/* Fd.rexx
- X Syntax : FD INFO <functionname> [<libraryname>]
- X Example: FD INFO FindPort exec
- X Result : prints the description of the function (offset, registers)
- X
- X Syntax : FD OFFS <offset> [<libraryname>]
- X Example: FD OFFS FF7A exec
- X Result : prints the description of the function
- X
- X Syntax : FD LIBS
- X Result : prints the available libraries (described by an FD.FILE)
- X*/
- X
- Xparse arg comselect others
- X
- Xdo while (words(getclip('FDDIR')) == 0)
- X say "Please enter the directory where the FD.FILES reside:"
- X say "Exemple: Extras 1.3:FD1.3"
- X pull fddir
- X fddir = strip(fddir)
- X call setclip('FDDIR',fddir)
- Xend
- Xfddir=getclip('FDDIR')
- Xfdfiles=showdir(fddir,'File')
- Xcomselect = upper(comselect)
- Xselect
- X when comselect=='INFO' then do
- X parse var others functionname libname
- X if length(libname) == 0
- X then call map('findin '''functionname"',", fdfiles)
- X else call findin(functionname,strip(libname)||'_LIB.FD')
- X end
- X when comselect=='OFFS' then do
- X parse var others offs libname
- X select
- X when datatype(offs) == NUM then nop
- X when datatype(offs) == CHAR then offs=x2d(offs) - 65536
- X otherwise do
- X say "Offset: -num (-30)"
- X say " hex (FFA0)"
- X exit 0
- X end
- X end
- X if length(libname) == 0
- X then call map('getfunc ' offs ",", fdfiles)
- X else call getfunc(offs,strip(libname)||'_LIB.FD')
- X end
- X when comselect=='LIBS' then do
- X fdlibs = map('fname2libname', fdfiles)
- X say "Libraries:" fdlibs
- X end
- X otherwise
- X do
- X say "Syntax : FD INFO <functionname> [<libraryname>]"
- X say " FD OFFS <offset> [<libraryname>]"
- X say " FD LIBS"
- X end
- X end
- X
- Xexit 0
- X
- X/* this should be familiar to you ol' lispers */
- Xmap: procedure expose fddir
- X if (words(arg(2)) == 0)
- X then return('')
- X else
- X parse value arg(2) with _car _cdr
- X interpret 'call' arg(1) '_car'
- X leftval = result
- X return( leftval map(arg(1), _cdr))
- X
- Xfname2libname: procedure
- X arg _fname
- X parse upper var _fname _libname '_LIB.FD'
- X return _libname
- X
- Xfindin: procedure expose fddir
- X success = open('handle',fddir||'/'||arg(2),'Read')
- X found = 0
- X offset = 0
- X privateflag = 'public '
- X if success then do until (found | eof('handle'))
- X line = readln('handle')
- X select
- X when left(line,1) == '*' then nop
- X when left(line,6) == '##bias' then do
- X parse var line '##bias' offset
- X offset = strip(offset)
- X end
- X when left(line,8) == '##public' then privateflag = 'public '
- X when left(line,9) == '##private' then privateflag = 'private'
- X when left(line,5) == '##end' then do close('handle') ; return('') ; end
- X when left(line,6) == '##base' then nop
- X otherwise do
- X if upper(left(line,length(arg(1)))) == upper(arg(1))
- X then found = 1
- X else offset = offset + 6
- X
- X end
- X end
- X end
- X else do
- X say "I don't find" arg(2) "in" fddir
- X return('')
- X end
- X call close('handle')
- X if found
- X then do
- X res=left(fname2libname(arg(2)),20) privateflag left('-'offset,4) d2x(65536 - offset) line
- X say res
- X return('')
- X end
- X else return('')
- X
- Xgetfunc: procedure expose fddir /* offs library */
- X success = open('handle',fddir||'/'||arg(2),'Read')
- X found = 0
- X offset = 0
- X privateflag = 'public '
- X if success then do until (found | eof('handle'))
- X line = readln('handle')
- X select
- X when left(line,1) == '*' then nop
- X when left(line,6) == '##bias' then do
- X parse var line '##bias' offset
- X offset = strip(offset)
- X end
- X when left(line,8) == '##public' then privateflag = 'public '
- X when left(line,9) == '##private' then privateflag = 'private'
- X when left(line,5) == '##end' then do close('handle') ; return('') ; end
- X when left(line,6) == '##base' then nop
- X otherwise do
- X if (offset == -arg(1))
- X then found = 1
- X else offset = offset + 6
- X end
- X end
- X end
- X else do
- X say "I don't find" arg(2) "in" fddir
- X return('')
- X end
- X call close('handle')
- X if found
- X then do
- X res=left(fname2libname(arg(2)),20) privateflag left('-'offset,4) d2x(65536 - offset) line
- X say res
- X return('')
- X end
- X else return('')
- END_OF_FILE
- if test 5018 -ne `wc -c <'rexx/fd.rexx'`; then
- echo shar: \"'rexx/fd.rexx'\" unpacked with wrong size!
- fi
- chmod +x 'rexx/fd.rexx'
- # end of 'rexx/fd.rexx'
- fi
- if test -f 'rexx/port.rexx' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rexx/port.rexx'\"
- else
- echo shar: Extracting \"'rexx/port.rexx'\" \(1615 characters\)
- sed "s/^X//" >'rexx/port.rexx' <<'END_OF_FILE'
- X/* AREXX Program */
- X/* I let you find out how to get out of this program
- X easily.
- X Answer at the end of the file (may not be really clean...)
- X*/
- XLIBRARIES.exec = '00 00 00 00'x
- XLIBRARIES.exec.OPENCOUNT = 0
- XLIBS.exec.FindPort='FE7A'x||S||'200A'x
- XLIBS.exec.AddPort='FE9E'x||A||'200A'x
- XLIBS.exec.RemPort='FE98'x||A||'200A'x
- XLIBS.exec.PutMsg='FE92'x||AA||'20090A'x
- XLIBS.exec.GetMsg='FE8C'x||A||'2009'x
- XLIBS.exec.ReplyMsg='FE86'x||A||'200A'x
- XLIBS.exec.WaitPort='FE80'x||A||'2009'x
- XLIBS.exec.AllocMem='FF3A'x||IA||'200102'x
- XLIBS.exec.FreeMem='FF2E'x||AI||'200A01'x
- XLIBS.exec.Wait='FEC2'x||A||'2001'x
- X
- X/* Note that we are going to mix AREXX support functions
- X and rxgen functions
- X*/
- XPORTNAME = 'TESTPORT'
- Xcall GenOpenLib("exec",0)
- Xmyport = GenACall("exec","FindPort",PORTNAME)
- Xif myport = NULL() then do
- X theport = OPENPORT(PORTNAME)
- X myport = GenACall("exec","FindPort",PORTNAME)
- X sigbitraw = import(OFFSET(myport,15),1)
- X sigbit = c2d(sigbitraw)
- X say "Signal Bit:" sigbit
- X if myport = NULL() then do
- X say "Can't create port"
- X exit 1
- X end
- X else do 10
- X msg = GenACall("exec","Wait",bitset(NULL(),sigbit))
- X say "Wait returned"
- X do msgloop=0
- X msg = GenACall("exec","GetMsg",myport)
- X if msg = null() then leave msgloop
- X call GenACall("exec","ReplyMsg",msg)
- X end
- X end
- X end
- Xcall GenCloseLib("exec")
- Xcall CLOSEPORT(PORTNAME)
- X
- X/* did you find out ? */
- X/* here you are:
- X rx "do forever; address TESTPORT; end"
- X*/
- END_OF_FILE
- if test 1615 -ne `wc -c <'rexx/port.rexx'`; then
- echo shar: \"'rexx/port.rexx'\" unpacked with wrong size!
- fi
- chmod +x 'rexx/port.rexx'
- # end of 'rexx/port.rexx'
- fi
- if test -f 'rexx/wbfront.rexx' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rexx/wbfront.rexx'\"
- else
- echo shar: Extracting \"'rexx/wbfront.rexx'\" \(322 characters\)
- sed "s/^X//" >'rexx/wbfront.rexx' <<'END_OF_FILE'
- X/* AREXX program */
- XLIBS.intuition = '00 00 00 00'x
- XLIBS.intuition.OPENCOUNT = 0
- XLIBS.intuition.WBenchToBack='FEB0'x||'20'x
- XLIBS.intuition.WBenchToFront='FEAA'x||'20'x
- X
- X/* can you write a shorter program for that ? */
- Xcall GenOpenLib("intuition",0)
- Xcall GenACall("intuition","WBenchToFront")
- Xcall GenCloseLib("intuition")
- END_OF_FILE
- if test 322 -ne `wc -c <'rexx/wbfront.rexx'`; then
- echo shar: \"'rexx/wbfront.rexx'\" unpacked with wrong size!
- fi
- chmod +x 'rexx/wbfront.rexx'
- # end of 'rexx/wbfront.rexx'
- fi
- if test -f 'rexx/wbmaster.rexx' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rexx/wbmaster.rexx'\"
- else
- echo shar: Extracting \"'rexx/wbmaster.rexx'\" \(9869 characters\)
- sed "s/^X//" >'rexx/wbmaster.rexx' <<'END_OF_FILE'
- X/* This file is Copyright(C) 1990 Francois Rouaix and the Software Winery */
- X/* This file must be distributed unmodified in the RXGEN package */
- X
- X/* An attempt at using the new features of the 2.0 Workbench library
- X Warning, look for comments /* WSHELL */ and /* CLI */ to fix the program
- X By default, the script in the distribution is configured for CLI, as
- X WShell is not yet distributed with 2.0 ;-)
- X
- X WSH> WBMASTER -INIT
- X WSH> WBMASTER <MENUNAME> <RXCLAUSE>
- X ....
- X Quit with menu
- X
- X CLI> rx WBMASTER -INIT
- X CLI> rx WBMASTER <MENUNAME> <RXCLAUSE>
- X ....
- X Quit with menu
- X
- X The -INIT call will init a "server process", which is called -RUN.
- X -RUN will add a QUIT item in the Workbench Tools menu.
- X The other kind of call will add an item of name <MENUNAME>. When you
- X activate this item, the <RXCLAUSE> will be INTERPRETed by the
- X server process.
- X
- XExample:
- X rx wbmaster -INIT
- X rx wbmaster Editor address command 'new:c/az'
- X rx wbmaster Shell address command 'newshell'
- X
- XWARNING: despite some efforts, there are still problems
- X 1) if the rxclause (executed when activating a menu) raises
- X an error, then you're lost. Try WBMASTER -QUIT to free
- X the ressources. However, don't try -QUIT option if -RUN is alive
- X 2) you can't remove a menu item individually
- X but you can patch the action of a menu item by hacking directly
- X the clip value WBACTIONi (see source)
- X 3) you'll have to figure out what king of actions may be taken !
- X Easy ones: ADDRESS COMMAND 'cli-detaching-command'
- X Easy ones: ADDRESS COMMAND 'run cli-permanent-command'
- X use the quotes to avoid syntax errors...
- X Try to interpret your clause with rx "INTERPRET <clause>"
- X to check before installing as a menu action
- X Tricky ones: parameterised actions, using Arexx clipboard as globals
- X Hacks: dynamic modification of the server Arexx program ....
- X 4) I've not really checked if all memory/ressources are freed
- X if everything goes wrong
- X Remember this is just a hack !
- X*/
- X
- Xarg COM PAR
- X
- X/* exec library */
- XLIBRARIES.exec = '00 00 00 00'x
- XLIBRARIES.exec.OPENCOUNT = 0
- XLIBS.exec.FindPort='FE7A'x||S||'200A'x
- XLIBS.exec.AddPort='FE9E'x||A||'200A'x
- XLIBS.exec.RemPort='FE98'x||A||'200A'x
- XLIBS.exec.PutMsg='FE92'x||AA||'20090A'x
- XLIBS.exec.GetMsg='FE8C'x||A||'2009'x
- XLIBS.exec.ReplyMsg='FE86'x||A||'200A'x
- XLIBS.exec.WaitPort='FE80'x||A||'2009'x
- XLIBS.exec.Wait='FEC2'x||A||'2001'x
- XLIBS.exec.CreateMsgPort='FD66'x||'20'x
- XLIBS.exec.DeleteMsgPort='FD60'x||A||'2009'x
- XLIBS.exec.AllocMem='FF3A'x||IA||'200102'x
- XLIBS.exec.FreeMem='FF2E'x||AI||'200A01'x
- X
- X/* workbench library */
- XLIBRARIES.workbench = '00 00 00 00'x
- XLIBRARIES.workbench.OPENCOUNT = 0
- XLIBS.workbench.AddAppMenuItem='FFB8'x||IAAA||'200102090A'x
- XLIBS.workbench.RemoveAppMenuItem='FFB2'x||A||'2009'x
- X
- XPORTNAME='WB-AREXX'
- XPORTLEN = 9
- X
- Xselect
- X when upper(arg(1)) = '-INIT' then do
- X/* this is some kind CLI-detach hack for ARexx scripts */
- X/* note the the MsgPort MUST be created by the task who is going
- X to receive the signals (that's because CreateMsgPort initializes
- X the port structure according to the caller's task)
- X Therefore we reload ourselves asynchronously (ickk) without doing anything
- X*/
- X call GenOpenLib("exec",36)
- X myport = GenACall("exec","FindPort",PORTNAME)
- X if myport = NULL() then
- X /* ADDRESS command 'run rx WBMASTER -RUN' /* this gives IO */ */
- X ADDRESS AREXX 'WBMASTER -RUN'
- X else say "WBMASTER already up and running"
- X call GenCloseLib("exec")
- X end /* end of -INIT */
- X
- X when upper(arg(1)) = '-RUN' then do
- X /* we shouldn't quit but by user control */
- X /* it does not seem to make a difference, but why ? */
- X signal off syntax
- X signal off error
- X call GenOpenLib("exec",36)
- X myport = GenACall("exec","FindPort",PORTNAME)
- X if myport = NULL() then do
- X myport = GenACall("exec","CreateMsgPort")
- X if myport = NULL() then do
- X say "Can't create port"
- X exit 1
- X end
- X else do
- X /* we MUST initialize the name and priority (RTFM) */
- X copystr = GenACall("exec","AllocMem",PORTLEN,'0001 0001'x)
- X call export(copystr,PORTNAME,PORTLEN)
- X call export(OFFSET(myport,10),copystr,4)
- X call export(OFFSET(myport,9),NULL(),1)
- X call GenACall("exec","AddPort",myport)
- X say "Port " PORTNAME " created"
- X sigbitraw = import(OFFSET(myport,15),1)
- X sigbit = c2d(sigbitraw)
- X say "Signal Bit:" sigbit
- X call setclip('WBINDEX',-1)
- X /* setting quit item: magic ! */
- X /* we add an item with no action, but it MUST be the first */
- X /* there is a special case for this in the server process */
- X /* 'WBMASTER ' QUIT /* for use with WSHELL ONLY */ */
- X address command 'rx WBMASTER QUIT' /* for use with CLI */
- X end
- X end
- X else do
- X say "WBMASTER already up and running"
- X exit 1
- X end
- X do quitloop=0
- X msg = GenACall("exec","Wait",bitset(NULL(),sigbit))
- X do msgloop=0
- X msg = GenACall("exec","GetMsg",myport)
- X if msg = null() then leave msgloop
- X am_Type = c2x(IMPORT(OFFSET(msg,20),2))
- X am_UserData = c2x(IMPORT(OFFSET(msg,22),4))
- X am_ID = c2d(IMPORT(OFFSET(msg,26),4))
- X am_NumArgs = c2d(IMPORT(OFFSET(msg,30),4))
- X call GenACall("exec","ReplyMsg",msg)
- X /* I don't know exactly where the output will go...
- X at least if the trace console is open, output will go there
- X in beta versions of 2.0, there used to be gurus, now with
- X 2.01, everything runs fine
- X */
- X say "Type:" am_Type "UserData:" am_UserData "Id:" am_ID "NumArgs:" am_NumArgs
- X if am_ID = 0 then leave quitloop
- X action = getclip('WBACTION'||am_ID)
- X say "Interpreting" action
- X INTERPRET action /* whoaaaaahhh */
- X end /* of msgloop */
- X end /* of quit loop */
- X /* normal deallocation follows */
- X /* ADDRESS AREXX 'WBMASTER -QUIT' /* pb: ??? when -RUN was launched by addressing AREXX*/ */
- X ADDRESS COMMAND 'rx WBMASTER -QUIT'
- X end /* end of -RUN */
- X
- X /* this is the cleanup: this portion of the code should be executed
- X by the -RUN process when you quit, but in case something goes wrong,
- X we need a cleanup (DON'T RUN THIS IF -RUN IS ALIVE)
- X */
- X when upper(arg(1)) = '-QUIT' then do
- X call GenOpenLib("exec",36)
- X myport = GenACall("exec","FindPort",PORTNAME)
- X if myport = NULL() then do
- X say "WBMASTER is not running"
- X end
- X else do /* first delete the port*/
- X call GenACall("exec","RemPort",myport)
- X do msgloop=0
- X msg = GenACall("exec","GetMsg",myport)
- X if msg = NULL() then leave msgloop
- X call GenACall("exec","ReplyMsg",msg)
- X end
- X call GenACall("exec","FreeMem",IMPORT(OFFSET(myport,10),4),PORTLEN)
- X call GenACall("exec","DeleteMsgPort",myport)
- X end
- X /* cleanup the menu */
- X call GenOpenLib("workbench",36)
- X do i=0 to getclip('WBINDEX')
- X item = getclip('WBITEM'i)
- X call GenACall("workbench","RemoveAppMenuItem",item)
- X text = getclip('WBTEXT'i)
- X textlen = getclip('WBTEXTLEN'i)
- X call GenACall("exec","FreeMem",text,textlen)
- X end
- X call setclip('WBINDEX',-1) /* Avoid multiple FreeMems if run twice*/
- X call GenCloseLib("workbench")
- X call GenCloseLib("exec")
- X end
- X
- X /* general case: install the menu item */
- X otherwise do
- X call GenOpenLib("exec",36)
- X myport = GenACall("exec","FindPort",PORTNAME)
- X if myport = NULL() then do
- X say "Can't find " PORTNAME
- X call GenCloseLib("exec")
- X exit 1
- X end
- X call GenOpenLib("workbench",36)
- X index = getclip('WBINDEX')
- X index = index+1
- X call setclip('WBINDEX',index)
- X COM = strip(com)
- X par = strip(par)
- X /* allocate copy of the string */
- X copystr = GenACall("exec","AllocMem",length(COM)+1,'0001 0001'x)
- X call export(copystr,COM,length(COM)+1)
- X
- X item = GenACall("workbench","AddAppMenuItem",index,NULL(),copystr,myport)
- X if item = NULL() then do
- X say "Adding item failed"
- X exit 1
- X end
- X call setclip('WBITEM'index,item)
- X call setclip('WBTEXT'index,copystr)
- X call setclip('WBTEXTLEN'index,length(COM)+1)
- X call setclip('WBACTION'index,PAR)
- X call GenCloseLib("workbench")
- X call GenCloseLib("exec")
- X end /* of otherwise */
- Xend /* of select */
- Xexit 0
- X
- X/* Hm, we need some offsets.
- Xstruct AppMessage {
- X struct Message am_Message; /* standard message structure */
- X UWORD am_Type; /* message type */
- X ULONG am_UserData; /* application specific */
- X ULONG am_ID; /* application definable ID */
- X LONG am_NumArgs; /* # of elements in arglist */
- X struct WBArg *am_ArgList; /* the arguements themselves */
- X};
- X*/
- END_OF_FILE
- if test 9869 -ne `wc -c <'rexx/wbmaster.rexx'`; then
- echo shar: \"'rexx/wbmaster.rexx'\" unpacked with wrong size!
- fi
- chmod +x 'rexx/wbmaster.rexx'
- # end of 'rexx/wbmaster.rexx'
- fi
- if test -f 'rxgen.doc' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rxgen.doc'\"
- else
- echo shar: Extracting \"'rxgen.doc'\" \(5894 characters\)
- sed "s/^X//" >'rxgen.doc' <<'END_OF_FILE'
- XTABLE OF CONTENTS
- X
- Xrxgen.library/GenOpenLib
- Xrxgen.library/GenCloseLib
- Xrxgen.library/GenACall
- Xrxgen.library/Function Description Format
- X
- X
- Xrxgen.library/GenOpenLib rxgen.library/GenOpenLib
- X
- XNAME
- X GenOpenLib -opens an exec library from Arexx
- X
- XSYNOPSIS
- X call GenOpenLib("library name",version)
- X
- XFUNCTION
- X REQUIREMENTS: the ARexx variables
- X LIBS.libname
- X LIBS.libname.OPENCOUNT
- X should be properly initialized when you open the library for
- X the first time.
- X For example, if you want to open exec.library, use the
- X following clauses:
- X LIBS.EXEC = '0000 0000'x
- X LIBS.EXEC.OPENCOUNT = 0
- X Opens the specified library, using the specified version number.
- X If the library can be opened, its base will be stored in LIBS.libname,
- X and the open count (for GenOpenLib calls in the current program only)
- X will be incremented in LIBS.libname.OPENCOUNT
- X Failure to open the library will raise an ERROR
- X
- XINPUTS
- X "library name" is the name of the library you want to open
- X (without .library suffix)
- X version is an integer
- XRESULT
- X You're not interested in the result (it is the opencount at this time,
- X but this is subject to change).
- X See above for side effects
- X
- XEXAMPLE
- X LIBS.intuition = '0000 0000'x
- X LIBS.intuition.OPENCOUNT = 0
- X call GenOpenLib("intuition",0)
- X
- XBUGS
- X Use of version not really tested.
- X Multiple uses with different version numbers are not supported.
- X
- X
- Xrxgen.library/GenCloseLib rxgen.library/GenCloseLib
- X
- X
- XNAME
- X GenCloseLib -close a library from Arexx
- X
- XSYNOPSIS
- X call GenCloseLib("libname")
- X
- XFUNCTION
- X REQUIREMENTS: same as GenOpenLib, it is also better if the
- X library has been opened...
- X Closes a library that has been opened by GenOpenLib.
- X Will fail if the opencount of the library is <= 0, otherwise,
- X the library will be closed, and the opencount decremented. If the count
- X gets null, then the base of the library will be set to 0.
- X
- XINPUTS
- X "libname" : the name of the library you want to close (what else ?)
- X
- XRESULT
- X You're not interested in the result (it is the opencount at this time,
- X but this is subject to change).
- X See above for side effects
- X
- XEXAMPLE
- X call GenCloseLib("intuition")
- X
- XBUGS
- X Maybe.
- X
- X
- Xrxgen.library/GenACall rxgen.library/GenACall
- XNAME
- X GenACall - call a function from ARexx
- X
- XSYNOPSIS
- X something = GenACall("libname","fname",par,...)
- X
- XFUNCTION
- X REQUIREMENTS:
- X the library should have been opened (see GenOpenLib)
- X the function fname should be defined by
- X LIBS.libname.fname = <description>
- X the format of the description is described later.
- X GenACall will check the base of the library, convert your parameters
- X following the description, and return (hopefully) the result.
- X If the library base is 0, the function will abort (ERROR).
- X If GenACall can't find the function description, it will abort.
- X
- XINPUTS
- X "libname" the name of the library your function belongs to
- X "fname" the name of the function
- X par,... parameters for the real function call. Many types allowed,
- X check the format of the description
- X
- XRESULT
- X A 32 bit word, hopefully a correct one...
- X
- XEXAMPLE
- X pointer = GenACall("exec","FindPort",'FOO BAR')
- X
- XBUGS
- X Surely. None found.
- X
- X
- Xrxgen.library/Function Description Format
- X
- X
- XDescription of the format:
- XLet's take an example to fix the ideas
- XLIBS.exec.FindPort='FE7A'x||S||'200A'x
- XThus, the format is a string containing:
- X - two bytes for the offset of the function in the library
- X - a variable number of characters that describe the type of
- X conversion to be applied to the parameters
- X - a SPACE (here obtained by '20'x)
- X - a coding of the registers in which the parameters will be passed.
- X
- XYou don't have to find all this by yourself.
- XThe FD2rxFD utility provided in this distribution is able to compute a
- Xpartial description from the FD.FILES (to be found on Extras disk).
- XCheck the two directory variables in the program, and run
- X1> rx fd2rxfd exec
- XThis will generate a file containing all (partial) function definitions
- Xfor the Exec library.
- X
- XIn this examples, the information given by the FD.FILES is
- XLIBS.exec.FindPort='FE7A'x||?||'200A'x
- XThe question mark (?) is to be replaced by the proper type description.
- X
- X Technical digression: the problem lies in the fact that datas in ARexx are
- X not typed. They all are represented by strings, with no way to determine
- X safely and systematically if a particular data is a "real" string, or
- X an integer, or a pointer.
- X
- XYou will have to find by yourself (consulting the proper docs) which kind
- Xof conversion is needed.
- XIn this version (1.0), the supported conversion are:
- X I the ARexx data represents an integer
- X It will be converted internally to a 32bit integer with the AREXX
- X function CVa2i().
- X Valid data examples: Invalid data:
- X 1 'foobar'
- X 324
- X
- X S the ARexx data represents a string.
- X No conversion is applied. The pointer to the string is used as
- X an argument
- X Valid data: any
- X
- X A the ARexx data represents a pointer.
- X It MUST be a 4-byte long string, containing the value of the
- X pointer (usual convention for pointers in AREXX).
- X The "raw" value of the data will be used.
- X Valid data examples:
- X '00 00 00 00'x
- X '00 00 06 76'x
- X
- XIn the example, the parameter is a port name, so the conversion should be S.
- X
- X
- XRegister coding is
- X D0 D1 D2 D3 D4 D5 D6 D7 A0 A1 A2 A3 A4 A5 A6 A7
- X 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E ** **
- X A6 is reserved for library base
- X A7 is SP. Don't dare to use it.
- X
- END_OF_FILE
- if test 5894 -ne `wc -c <'rxgen.doc'`; then
- echo shar: \"'rxgen.doc'\" unpacked with wrong size!
- fi
- chmod +x 'rxgen.doc'
- # end of 'rxgen.doc'
- fi
- if test -f 'rxgen.readme' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rxgen.readme'\"
- else
- echo shar: Extracting \"'rxgen.readme'\" \(4005 characters\)
- sed "s/^X//" >'rxgen.readme' <<'END_OF_FILE'
- X/*
- X *===========================================================================
- X * \__________/ Copyright (c) 1990 Francois Rouaix and The Software Winery.
- X * \o o / All Rights Reserved. This program may not be distributed
- X * \ o o/ without the permission of the author:
- X * \ o / Francois Rouaix
- X * \ o/ 7 rue de la Ferme
- X * || 78150 Le Chesnay FRANCE
- X * || Contact The Software Winery at:
- X * || BBS : +33 (1) 39 55 84 59 (V23 Videotex)
- X * || MAIL : c/o Alain DIDIERJEAN 69 rue Dunois
- X * || 75646 Paris cedex 13 FRANCE
- X * <====> INTERNET: rouaix@inria.inria.fr
- X *===========================================================================
- X */
- X
- X
- X RXGEN README
- X Version 1.0 (First released version)
- X
- XOverview:
- X RXGEN is an ARexx library designed for the hacker.
- X This library allows you to call any function of (almost) any amiga
- X library from a Arexx program.
- X I would say it is essentially useful under 2.0 to test some of
- X the new "high-level" features of the system. It also works under 1.3.
- X You can use the library to write small programs, when you don't want
- X to use your C-compiler ! Eventually, your program will get bigger and
- X bigger, and you'll find out that either you don't need your C-compiler,
- X or that Arexx is slow (heheh).
- X
- X
- XDistribution:
- X The rxgen distribution consists in the following files
- X libs/rxgen.library the library itself
- X rxgen.readme (this file)
- X rxgen.doc autodoc file
- X rexx/FD2rxFD.rexx filter from FD.FILES to specific format
- X
- X rexx/db.rexx DisplayBeep example
- X rexx/wbfront.rexx WBenchToFront example
- X rexx/alert.rexx DisplayAlert example
- X rexx/port.rexx MsgPort example
- X
- X rexx/fd.rexx Scanner for FD.FILES
- X rexx/wbmaster.rexx AppMenuItems under 2.0
- X
- X All the files of the distribution are Copyright (C) 1990 Francois Rouaix
- X and The Software Winery.
- X RXGEN is NOT Public Domain, but can be distributed freely, provided
- X all files are included, unmodified. Inclusion in a commercial product
- X requires previous written permission from the author.
- X
- XInstallation:
- X You will have to
- X -copy rxgen.library to your libs: directory (or any :libs directory
- X under 2.0)
- X -install the script FD2rxFD.rexx in your rexx: directory
- X -install rxgen.library in the list of arexx libraries with either
- X 1> rxlib rxgen.library 0 -30 0
- X or the usual ARexx clause:
- X if ~show('L','rxgen.library') then call addlib('rxgen.library',0,-30,0)
- X
- XFunctionalities:
- X rxgen provides you with 3 functions,
- X GenOpenLib generic open library
- X GenCloseLib generic close library
- X GenACall generic assembly call
- X
- X GenACall will need a definition of the function it will call.
- X Fortunately, part of this definition can be obtained automatically
- X from the FD.FILES (found on the Extras disk), through the
- X ARexx program FD2rxFD. More details in the autodocs.
- X
- XIn the distribution, you will find an autodoc file for these three functions.
- XYou're invited to check with the examples (the examples have to run, the doc
- Xdoesn't). Examples are usually documented when needed (!).
- X
- XSpecial offer:
- X -INCLUDED in the distribution is an example (wbmaster.rexx) using a
- X new 2.0 feature of the Workbench: AppMenuItems
- X Read the comments. Use with care.
- X
- X -INCLUDED in the distribution is an utility (fd.rexx) for scanning
- X the FD.FILES when looking for
- X * either function OFFSET when function name is known
- X * or function name when OFFSET is known
- X
- XBug reports, comments, suggestions: see my mail/e-mail address in the header
- X
- X Francois Rouaix
- X
- END_OF_FILE
- if test 4005 -ne `wc -c <'rxgen.readme'`; then
- echo shar: \"'rxgen.readme'\" unpacked with wrong size!
- fi
- chmod +x 'rxgen.readme'
- # end of 'rxgen.readme'
- fi
- echo shar: End of archive 1 \(of 1\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have the archive.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
- --
- Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
- Mail comments to the moderator at <amiga-request@uunet.uu.net>.
- Post requests for sources, and general discussion to comp.sys.amiga.misc.
-